<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.Connection" %>
<%@page import="java.sql.*" %>
<%@ page import="GoodsPackage.Good" %>
<%@ page import="java.util.List" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%--
  Created by IntelliJ IDEA.
  User: 123
  Date: 2022/1/4
  Time: 12:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>搜索详情</title>

    <link rel="stylesheet" type="text/css" href="css/public.css"/>
    <link rel="stylesheet" type="text/css" href="css/book.css"/>
    <link rel="stylesheet" type="text/css" href="css/details.css"/>
    <script src="js/jquery-3.6.0.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/front_page.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="css/shouye.css"/>
</head>
<body>
<div class="head">
    <div class="shouye_head">
        <div class="shou_head">
            <a href="first.jsp">商城首页</a>
        </div>
        <div class="car">
            <a href="car.jsp"><img src="images/购物车.png" height="28px">
                <span>购物车</span>
            </a>
        </div>
        <div class="login">
            <div><a href="Register.jsp">登录</a></div>
            <div><a href="Register.jsp">注册</a></div>
        </div>
    </div>
</div>
<div class="search_kuang">
    <div class="search">
        <form action="./SearchGood.do" method="GET">
            <input type="text" class="text" name="searchQuery">
            <button type="submit"><img src="images/搜索图标.png" width="40px"></button>
        </form>
    </div>
</div>
<div class="xi_nav">
    <div class="wrap">
        <ul class="menu-list">
            <li class="menu"><a href="first.jsp">首页</a></li>
            <li class="menu"><a href="#">全部分类</a></li>
            <li class="menu"><a href="#">新品上市</a></li>
            <li class="menu"><a href="#">热卖推荐</a></li>
        </ul>
    </div>
</div>
<div class="w">
    <div class="phone-list">
        <%
            List<Good> goods = (List<Good>)request.getSession().getAttribute("goods");

            if (goods != null && goods.size() > 0) {
                for (Good good : goods) {
        %>
        <li class="phone-item">
            <a href="./detail.do?id=<%= good.getGoods_id() %>">
                <div class="ph">
                    <img src="<%= good.getPic() %>" alt="书籍图片">
                    <div class="na"><%= good.getGoods_name() %></div>
                    <p>￥<%=good.getUnitprice() %></p>
                </div>
            </a>
        </li>
        <%
            }
        } else {
        %>
        <p>暂无此类商品。</p>
        <%
            }
        %>
    </div>
</div>
<div class="footer">
    <div class="translate">
        <div class="footer-links">
            <h5>购物指南</h5>
            <ul>
                <li><a href="#">购物流程</a></li>
                <li><a href="#">会员介绍</a></li>
                <li><a href="#">生活旅行</a></li>
                <li><a href="#">常见问题</a></li>
                <li><a href="#">联系客服</a></li>
            </ul>
        </div>
        <div class="footer-links">
            <h5>支付方式</h5>
            <ul>
                <li><a href="#">信用卡</a></li>
                <li><a href="#">货到付款</a></li>
                <li><a href="#">在线付款</a></li>
                <li><a href="#">分期付款</a></li>
            </ul>
        </div>
        <div class="footer-links">
            <h5>售后服务</h5>
            <ul>
                <li><a href="#">售后政策</a></li>
                <li><a href="#">退款说明</a></li>
                <li><a href="#">返修/退换货</a></li>
            </ul>
        </div>
        <div class="footer-links">
            <h5>帮助中心</h5>
            <ul>
                <li><a href="#">账户管理</a></li>
                <li><a href="#">自助服务</a></li>
                <li><a href="#">订单操作</a></li>
                <li><a href="#">服务网点</a></li>
                <li><a href="#">授权体验店/专区</a></li>
            </ul>
        </div>
        <div class="footer-links">
            <h5>关于我们</h5>
            <ul>
                <li><a href="#">新浪微博</a></li>
                <li><a href="#">官方微信</a></li>
                <li><a href="#">联系我们</a></li>
                <li><a href="#">加入我们</a></li>
                <li><a href="#">公益基金会</a></li>
            </ul>
        </div>
    </div>
</div>
</body>
</html>
